<?php

require_once 'SpecHelper.php';

class DescribeMutationGenerator extends PHPSpec_Context
{

    protected $runner = null;

    public function before() 
    {
        // this would all be setup via PHPMutagen_Console_Command normally
        $this->runner = new PHPMutagen_Runner;
        $this->runner->setBaseDirectory('./_files2');
        $this->runner->setWorkingDirectory('./.wdir');
        $this->runner->setSourceDirectory('./.wdir/src');
        $this->runner->prepare();
    }

    public function itShouldGenerateACollectionOfFileMutableObjects() 
    {
        $generator = new PHPMutagen_Generator($this->runner);
        $generator->setMutableFileClass('StubMutableFile1');
        $generator->generate();
        $this->spec(gettype($generator->getMutables()))->should->be('array');
    }

}

class StubMutableFile1 extends PHPMutagen_MutableFile
{
    public function __construct() 
    {
    }
    public function generateMutations() 
    {
        return;
    }
    public function getMutations() 
    {
        return array();
    }
}